package net.java.nioserver.utils;

/**
 * Medium-quality Random Number Generator Suitable for Testing.
 * JCIP, Chapter 12, Listing 12.4.
 *
 * @author Leonid Shlyapnikov
 */
public class MediumQualityRandomNumGenerator {

    private MediumQualityRandomNumGenerator() {
    }

    public static int xorShift(int seed) {
        int y = seed;
        y ^= (y << 6);
        y ^= (y >>> 21);
        y ^= (y << 7);
        return y;
    }
}
